import request from '@/utils/request'
// import axios from 'axios'
import { apiVersion } from '@/config'

// 获取详情
export function getScenarioDetail(data) {
    return request({
        url: `/admin/${apiVersion}/game/scenario/${data.id}`,
        method: 'get',
        data
    })
}
// 分页列表
export function getScenarios(data) {
    return request({
        url: `/admin/${apiVersion}/game/scenario`,
        method: 'get',
        data
    })
}
// 删除
export function delScenario(data) {
    return request({
        url: `/admin/${apiVersion}/game/scenario/${data.id}`,
        method: 'delete',
        data
    })
}
// 创建
export function addScenario(data) {
    return request({
        url: `/admin/${apiVersion}/game/scenario`,
        method: 'post',
        data
    })
}
export function putScenario(data) {
    return request({
      url: `/admin/${apiVersion}/game/scenario`,
      method: 'put',
      data: data
    })
  }
// 查询列表
export function getAllScenarios(data) {
    return request({
        url: `/admin/${apiVersion}/game/scenario/all`,
        method: 'get',
        data
    })
}

/**
 * 启动
 * @param {} data 
 */
export function startScenario(data) {
return request({
    url: `/admin/${apiVersion}/game/scenario/${data.id}/start`,
    method: 'put',
    data
})
}
/**
 * 停止
 * @param {} data 
 */
export function stopScenario(data) {
return request({
    url: `/admin/${apiVersion}/game/scenario/${data.id}/stop`,
    method: 'put',
    data
})
}
/**
 * 获取podname
 * @param {*} data 
 */
export function getScenarioPodName(data) {
  return request({
    url: `/admin/${apiVersion}/game/scenario/${data.id}/podName`,
    noLoadding: true,
    method: 'get',
  })
}

/**
 * 获取仿真命令
 * @param {*} data 
 */
export function getScenarioCommand(data) {
    return request({
      url: `/admin/${apiVersion}/game/scenario/${data.id}/getCommand`,
      noLoadding: true,
      method: 'get',
    })
  }
